From 235eec589d5e8e744f3c822769c87287d0b84b1a Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Fri, 23 Feb 2024 14:17:29 -0600 Subject: [PATCH] Upgrade from psycopg2 to psycopg3; drop python <= v3.5, add v3.8-v3.11 --- setup.py | 8 +++++--- src/pgwui_upload/views/upload.py | 8 ++++---- tox.ini | 8 +++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 692b295..f94dc5e 100644 --- a/setup.py +++ b/setup.py @@ -116,10 +116,12 @@ setup( # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], # What does your project relate to? @@ -160,7 +162,7 @@ setup( 'markupsafe', 'pgwui_core==' + version, 'pgwui_upload_core==' + version, - 'psycopg2', + 'psycopg', 'pyramid', ], diff --git a/src/pgwui_upload/views/upload.py b/src/pgwui_upload/views/upload.py index 8a91ef6..4ab2326 100644 --- a/src/pgwui_upload/views/upload.py +++ b/src/pgwui_upload/views/upload.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015, 2018, 2020, 2021 The Meme Factory, Inc. +# Copyright (C) 2015, 2018, 2020, 2021, 2024 The Meme Factory, Inc. # http://www.karlpinc.com/ # This file is part of PGWUI_Upload. @@ -31,7 +31,7 @@ from __future__ import absolute_import from __future__ import division import attr -import psycopg2 +import psycopg from pyramid.view import view_config import logging @@ -71,7 +71,7 @@ class SaveLine(DataLineProcessor): ue UploadEngine instance uh UploadHandler instance insert_stmt Statement used to insert into db. - (psycopg2 formatted for substituion) + (psycopg3 formatted for substituion) ''' super(SaveLine, self).__init__(ue, uh) self.insert_stmt = insert_stmt @@ -154,7 +154,7 @@ class TableUploadHandler(BaseTableUploadHandler): ue.data, qualified_table, quotecols, column_quoter) return SaveLine(ue, self, insert_stmt) - except (core_ex.PGWUIError, psycopg2.Error): + except (core_ex.PGWUIError, psycopg.Error): self.data.lineno = 0 # Don't report partially read number of lines raise diff --git a/tox.ini b/tox.ini index 6f86776..fdd9e11 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,14 @@ [tox] -envlist = py{34,35,36,37} +envlist = py{36,37,38,39,310,311} [testenv] basepython = - py34: python3.4 - py35: python3.5 py36: python3.6 py37: python3.7 + py38: python3.8 + py39: python3.9 + py310: python3.10 + py311: python3.11 deps = check-manifest cmarkgfm -- 2.34.1